export default {
  computed: {
    // 表格中列字段
    columns() {
      return [
        {
          key: "sf_code",
          title: {
            "zh-CN": "预警编码",
            "en-US": "sf_code",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "sf_name",
          title: {
            "zh-CN": "预警名称",
            "en-US": "sf_name",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "sf_energyCode",
          title: {
            "zh-CN": "能源编码",
            "en-US": "sf_energyCode",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "sf_energyName",
          title: {
            "zh-CN": "能源名称",
            "en-US": "sf_energyName",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
          render: (h, params) => {
            return h('div', {}, this.getOptionValue(this.energyCodeOptions, params.row.sf_energyCode))
          },
          config: { type: 'select', options: this.energyCodeOptions, disabled:true }
        },
        {
          key: "sf_energyType",
          title: {
            "zh-CN": "能源类别",
            "en-US": "sf_energyType",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "sf_energyTypeName",
          title: {
            "zh-CN": "能源类别名称",
            "en-US": "sf_energyTypeName",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "sf_pointName",
          title: {
            "zh-CN": "数采点位",
            "en-US": "sf_pointName",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "sf_scale",
          title: {
            "zh-CN": "报警统计粒度",
            "en-US": "sf_scale",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
          render: (h, params) => {
            return h('div', {}, this.getOptionValue(this.scaleOptions, params.row.sf_scale))
          },
          config: { type: 'select', options: this.scaleOptions, disabled:true }
        },
        {
          key: "df_upperLimit",
          title: {
            "zh-CN": "上上限",
            "en-US": "df_upperLimit",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "upperLimitContent",
          title: {
            "zh-CN": "上上限报警显示内容",
            "en-US": "upperLimitContent",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: false,
          config: { type: "textarea" },
        },
        {
          key: "upperLimitColor",
          title: {
            "zh-CN": "上上限报警显示颜色",
            "en-US": "upperLimitColor",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: false,
          config: { type: 'select', options: this.colorOptions,disabled:true },
        },
        {
          key: "df_upLimit",
          title: {
            "zh-CN": "上限",
            "en-US": "df_upLimit",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "upLimitContent",
          title: {
            "zh-CN": "上限报警显示内容",
            "en-US": "upLimitContent",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: false,
          config: { type: "textarea" },
        },
        {
          key: "upLimitColor",
          title: {
            "zh-CN": "上限报警显示颜色",
            "en-US": "upLimitColor",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: 'select', options: this.colorOptions,disabled:true },
        },
        {
          key: "df_lowerLimit",
          title: {
            "zh-CN": "下限",
            "en-US": "df_lowerLimit",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "lowLimitContent",
          title: {
            "zh-CN": "下限报警显示内容",
            "en-US": "lowLimitContent",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: false,
          config: { type: "textarea" },
        },
        {
          key: "lowLimitColor",
          title: {
            "zh-CN": "下限报警显示颜色",
            "en-US": "lowLimitColor",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: false,
          config: { type: 'select', options: this.colorOptions,disabled:true },
        },
        {
          key: "df_lowLimit",
          title: {
            "zh-CN": "下下限",
            "en-US": "df_lowLimit",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "lowerLimitContent",
          title: {
            "zh-CN": "下下限报警显示内容",
            "en-US": "lowerLimitContent",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: false,
          config: { type: "textarea" },
        },
        {
          key: "lowerLimitColor",
          title: {
            "zh-CN": "下下限报警显示颜色",
            "en-US": "lowerLimitColor",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: false,
          config: { type: 'select', options: this.colorOptions,disabled:true },
        },
      //   {
      //     key: "notifier",
      //     title: {
      //       "zh-CN": "预警负责人",
      //       "en-US": "notifier",
      //     }[this.G_Locale],
      //     minWidth: 200,
      //     align: "center",
      //     show: true,
      //     render: (h, params) => {
      //       return h("div", {}, this.getPersonName(params.row.notifier));
      //     },
      //   },
      //   {
      //     key: "remark",
      //     title: {
      //       "zh-CN": "备注",
      //       "en-US": "remark",
      //     }[this.G_Locale],
      //     minWidth: 100,
      //     align: "center",
      //     show: true,
      //   },
        {
          key: "createdBy",
          title: {
            "zh-CN": "创建人账号",
            "en-US": "created by",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "createTime",
          title: {
            "zh-CN": "创建时间",
            "en-US": "create time",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "updatedBy",
          title: {
            "zh-CN": "修改人账号",
            "en-US": "updated by",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "updateTime",
          title: {
            "zh-CN": "修改时间",
            "en-US": "update time",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
      ];
    },
    // form中列字段
    formColumns() {
      return [
        {
          key: "sf_code",
          title: {
            "zh-CN": "预警编码",
            "en-US": "sf_code",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "sf_name",
          title: {
            "zh-CN": "预警名称",
            "en-US": "sf_name",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "sf_energyName",
          title: {
            "zh-CN": "能源名称",
            "en-US": "sf_energyName",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: 'select', options: this.energyCodeOptions },
        },
        {
          key: "sf_energyCode",
          title: {
            "zh-CN": "能源编码",
            "en-US": "sf_energyCode",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: ''},
        },
        {
          key: "sf_energyType",
          title: {
            "zh-CN": "能源类别",
            "en-US": "sf_energyType",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "" },
        },
        {
          key: "sf_energyTypeName",
          title: {
            "zh-CN": "能源类别名称",
            "en-US": "sf_energyTypeName",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          config: { type: "" },
        },
        {
          key: "sf_pointName",
          title: {
            "zh-CN": "数采点位",
            "en-US": "sf_pointName",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "sf_scale",
          title: {
            "zh-CN": "报警统计粒度",
            "en-US": "sf_scale",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",          
          config: { type: 'select', options: this.scaleOptions }
        },
        {
          key: "df_upperLimit",
          title: {
            "zh-CN": "上上限",
            "en-US": "df_upperLimit",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "number" },
        },
        {
          key: "upperLimitContent",
          title: {
            "zh-CN": "上上限报警显示内容",
            "en-US": "upperLimitContent",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "textarea" },
        },
        {
          key: "upperLimitColor",
          title: {
            "zh-CN": "上上限报警显示颜色",
            "en-US": "upperLimitColor",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: 'select', options: this.colorOptions },
        },
        {
          key: "df_upLimit",
          title: {
            "zh-CN": "上限",
            "en-US": "df_upLimit",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          config: { type: "number" },
        },
        {
          key: "upLimitContent",
          title: {
            "zh-CN": "上限报警显示内容",
            "en-US": "upLimitContent",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "textarea" },
        },
        {
          key: "upLimitColor",
          title: {
            "zh-CN": "上限报警显示颜色",
            "en-US": "upLimitColor",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: 'select', options: this.colorOptions },
        },
        {
          key: "df_lowerLimit",
          title: {
            "zh-CN": "下限",
            "en-US": "df_lowerLimit",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          config: { type: "number" },
        },
        {
          key: "lowLimitContent",
          title: {
            "zh-CN": "下限报警显示内容",
            "en-US": "lowLimitContent",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "textarea" },
        },
        {
          key: "lowLimitColor",
          title: {
            "zh-CN": "下限报警显示颜色",
            "en-US": "lowLimitColor",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: 'select', options: this.colorOptions },
        },
        {
          key: "df_lowLimit",
          title: {
            "zh-CN": "下下限",
            "en-US": "df_lowLimit",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          config: { type: "number" },
        },
        {
          key: "lowerLimitContent",
          title: {
            "zh-CN": "下下限报警显示内容",
            "en-US": "lowerLimitContent",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "textarea" },
        },
        {
          key: "lowerLimitColor",
          title: {
            "zh-CN": "下下限报警显示颜色",
            "en-US": "lowerLimitColor",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: 'select', options: this.colorOptions },
        },
      //   {
      //     key: "remark",
      //     title: {
      //       "zh-CN": "备注",
      //       "en-US": "remark",
      //     }[this.G_Locale],
      //     minWidth: 100,
      //     align: "center",
      //     config: { type: "textarea" },
      //   },
      ];
    },
    queryFormItem() {
      return [
        {
          key: "sf_code",
          title: {
            "zh-CN": "预警编码",
            "en-US": "sf_code",
          }[this.G_Locale],
          config: { type: "" },
        },
        {
          key: "sf_name",
          title: {
            "zh-CN": "预警名称",
            "en-US": "sf_name",
          }[this.G_Locale],
          config: { type: "" },
        },
        {
          key: "sf_energyCode",
          title: {
            "zh-CN": "能源编码",
            "en-US": "sf_energyCode",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
        {
          key: "sf_energyName",
          title: {
            "zh-CN": "能源名称",
            "en-US": "sf_energyName",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
      ];
    },
    collapseFormItem() {
      return [
        {
          key: "sf_code",
          title: {
            "zh-CN": "预警编码",
            "en-US": "sf_code",
          }[this.G_Locale],
          config: { type: "" },
        },
        {
          key: "sf_name",
          title: {
            "zh-CN": "预警名称",
            "en-US": "sf_name",
          }[this.G_Locale],
          config: { type: "" },
        },
        {
          key: "sf_energyCode",
          title: {
            "zh-CN": "能源编码",
            "en-US": "sf_energyCode",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
        {
          key: "sf_energyName",
          title: {
            "zh-CN": "能源名称",
            "en-US": "sf_energyName",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
      ];
    },
    lang() {
      return {
        "en-US": {
          cancel: "cancel",
          confirmDelete: "confirm delete?",
        },
        "zh-CN": {
          cancel: "取消",
          confirmDelete: "确认删除？",
        },
      }[this.G_Locale];
    },
  },
};
